Socket
Socket
Sign inDemoInstall

@syncfusion/ej2-base

Package Overview
Dependencies
0
Maintainers
2
Versions
201
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@syncfusion/ej2-base


Version published
Weekly downloads
186K
decreased by-4.02%
Maintainers
2
Install size
2.46 MB
Created
Weekly downloads
 

Package description

What is @syncfusion/ej2-base?

@syncfusion/ej2-base is a foundational package for Syncfusion's Essential JS 2 library. It provides core utilities, base classes, and common functionalities that are used across various Syncfusion components. This package is essential for building and managing Syncfusion components in a consistent and efficient manner.

What are @syncfusion/ej2-base's main functionalities?

Event Handling

The EventHandler module allows you to add, remove, and manage event listeners on DOM elements. In this example, a click event listener is added to an element with the ID 'myElement'.

const { EventHandler } = require('@syncfusion/ej2-base');

function clickHandler() {
  console.log('Element clicked');
}

const element = document.getElementById('myElement');
EventHandler.add(element, 'click', clickHandler);

Data Binding

The DataManager module provides a way to manage and query data collections. In this example, a DataManager is created with a simple array of objects, and a query is executed to find an object with an id of 1.

const { DataManager, Query } = require('@syncfusion/ej2-base');

const data = [
  { id: 1, name: 'John' },
  { id: 2, name: 'Jane' }
];

const dataManager = new DataManager(data);
const query = new Query().where('id', 'equal', 1);

dataManager.executeQuery(query).then((result) => {
  console.log(result);
});

Utility Functions

The extend function is a utility that allows you to merge the properties of multiple objects into a single object. In this example, obj1 and obj2 are merged, with properties from obj2 overwriting those in obj1.

const { extend } = require('@syncfusion/ej2-base');

const obj1 = { a: 1, b: 2 };
const obj2 = { b: 3, c: 4 };

const extendedObj = extend({}, obj1, obj2);
console.log(extendedObj); // Output: { a: 1, b: 3, c: 4 }

Other packages similar to @syncfusion/ej2-base

Readme

Source

A common package of Essential JS 2 base libraries, methods and class definitions. It comes with full documentation and support and is available under commercial and community licenses – please visit www.syncfusion.com to get started.

Resources

Demos

Changelog

Check the changelog here

Keywords

FAQs

Last updated on 26 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc